#Examples from: http://matplotlib.org/basemap/users/geography.html


#Plotting data on a map:
#http://matplotlib.org/basemap/users/examples.html

#getting coordinates form google maps
#https://support.google.com/maps/answer/18539?hl=en

'''
Get the coordinates of a place

Get the coordinates of a place you find on the map with your browser, 
like Chrome, Firefox, or Internet Explorer.

Open Google Maps.
Right-click the place or area on the map.
Select What's here?
Under the search box, an info card with coordinates will appear.

http://matplotlib.org/basemap/api/basemap_api.html?highlight=basemap#mpl_toolkits.basemap.Basemap


https://support.google.com/earth/answer/148110?hl=en
Google Earth projection
Google Earth uses Simple Cylindrical projection with a WGS84 datum for its imagery base

Simple Cylindrical (Plate Carree)    Projection
Google Earth Image Base
Typically, the data you import into the Google Earth application is created 
with a specific geographic coordinate system, such as a Universal Transverse 
Mercator (UTM) projection and a NAD27 datum (North American Datum of 1927). 
Each geographic coordinate system may assign slightly different coordinates 
to the same location on the earth. When you import data into Google Earth, your
 data is interpreted according to the Google Earth coordinate system.

In the majority of cases, reprojection works as expected. In some situations,
the transformation might not work properly. In that case, you can use a third-party
tool to transform your data from its original coordinate system into the one used by Google Earth.

'''

#raise ValueError('must either specify lat/lon values of corners 
#(llcrnrlon,llcrnrlat,ucrnrlon,urcrnrlat) in degrees or width and height in meters')
#ValueError: must either specify lat/lon values of corners 
#(llcrnrlon,llcrnrlat,ucrnrlon,urcrnrlat) in degrees or width and height in meters


from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
# setup Lambert Conformal basemap.
#m = Basemap(width=12000000,height=9000000,projection='ortho',
#            resolution='c',lat_1=45.,lat_2=55,lat_0=50,lon_0=-107.)
m = Basemap(projection='cyl', resolution='f',llcrnrlat=41.1,  llcrnrlon=-71.1,
            urcrnrlat=43.0,
            urcrnrlon=-69.9)
# draw coastlines.
m.drawcoastlines()
# draw a boundary around the map, fill the background.
# this background will end up being the ocean color, since
# the continents will be drawn on top.
m.drawmapboundary(fill_color='grey')
# fill continents, set lake color same as ocean color.
m.fillcontinents(color='green',lake_color='aqua')
plt.show()